package com.dzl.voucherSecret.service.impl;

import com.dzl.voucherSecret.pojo.WelfareVoucherSecret;
import com.dzl.voucherSecret.dao.WelfareVoucherSecretMapper;
import com.dzl.voucherSecret.pojo.query.VoucherSecretQuery;
import com.dzl.voucherSecret.pojo.vo.VoucherSecretVo;
import com.dzl.voucherSecret.service.WelfareVoucherSecretService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.dzl.base.service.BaseServiceImpl;

import java.util.List;

/**
 * 劵密信息表(WelfareVoucherSecret)表服务实现类
 * @author caobucao
 * @date 2021-05-22 14:18:53
 */
@Service
public class WelfareVoucherSecretServiceImpl extends BaseServiceImpl<WelfareVoucherSecret> implements WelfareVoucherSecretService {

    @Autowired
    private WelfareVoucherSecretMapper mapper;


    @Override
    public List<VoucherSecretVo> queryVoucherSecretPage(VoucherSecretQuery query) {
        PageHelper.startPage(query);
        return mapper.queryVoucherSecretPage(query);
    }

    @Override
    public Integer updateIsExpiredByExpiredTime() {
        return mapper.updateIsExpiredByExpiredTime();
    }

    @Override
    public List<WelfareVoucherSecret> getVoucherSecretListByIds(List<Integer> idList) {
        return mapper.getVoucherSecretListByIds(idList);
    }

    @Override
    public List<WelfareVoucherSecret> getVoucherSecretListLimitByQuantity(Integer quantity,Integer skuId) {
        return mapper.getVoucherSecretListLimitByQuantity(quantity,skuId);
    }

    @Override
    public Integer updateVoucherSecretUsed(Integer userId, List<Integer> idList) {
        return mapper.updateVoucherSecretUsed(userId, idList);
    }

    @Override
    public List<VoucherSecretVo> queryOrderVoucherSecret(VoucherSecretQuery query) {
        return mapper.queryVoucherSecretPage(query);
    }

    @Override
    public Integer deleteVoucherSecretByGroupId(Integer groupId) {
        return mapper.deleteVoucherSecretByGroupId(groupId);
    }
}
